﻿using Autofac;
using System.Reflection;

namespace HDS.Extension.ServiceExtension
{
    public class AutofacModuleRegister : Autofac.Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            //builder.RegisterType<SysUserService>().InstancePerLifetimeScope();
            //builder.RegisterType<SysRoleService>().InstancePerLifetimeScope();
            //builder.RegisterType<SysFunService>().InstancePerLifetimeScope();

            var assemblysServices = Assembly.Load("HDS.Service");
            builder.RegisterAssemblyTypes(assemblysServices)
                      .AsImplementedInterfaces()
                      .InstancePerDependency();
        }
    }
}
